package kr.co.casually;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.HandlerThread;

 class WaitDlg extends HandlerThread {
		Context mContext;
		String mTitle;
		String mMsg;
		ProgressDialog mProgress;
	
		WaitDlg(Context context, String title, String msg) {
			super("잠시만 기다려 주세요");
			mContext = context;
			mTitle = title;
			mMsg = msg;
	
			setDaemon(true);
		}
	
		public void onLooperPrepared() {
			mProgress = new ProgressDialog(mContext);
			mProgress.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgress.setMessage(mMsg);
			mProgress.setCancelable(false);
			mProgress.show();
		}
	
		void stop(WaitDlg dlg) {
			dlg.mProgress.dismiss();
			try { Thread.sleep(100); } catch (InterruptedException e) {;}
			dlg.getLooper().quit();
		}
	}
 
 
